import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * I am Gigante
 * @author Hugo Armando Rodríguez Flores 
 * @version May 25th 2013
 */
public class Gigante extends Jefe
{
    /**
     * Defines the properties for Gigante
     */
    public Gigante()
    {
        super();
        super.storeImages(5, "gig");
        super.setDirection(true);
    }
    
    public void act() 
    {
        if (!this.getRemoveFlag())
        {
            super.thomasDetection(20);
            super.attackTiming(20);
            super.act();
        }
        else
            super.removeEnemy();
    }
    
    /**
     * Defines how Gigante will move
     */
    public void movementAnimation()
    {
        super.reverseImages();
        switch (super.getMoveCounter())
        {
            case 0: this.setImage(super.getElement(2));  super.moveCounterIncr();  break;
            case 2: this.setImage(super.getElement(1));  super.moveCounterIncr();  break;
            case 4: this.setImage(super.getElement(0));  super.moveCounterIncr();  break;
            case 6: this.setImage(super.getElement(1));  super.moveCounterIncr();  break;
            case 8:     super.setMoveCounter(0);  break;
            default: super.moveCounterIncr();
        }
    }
    
    /**
     * Defines how Gigante will atack Thomas.
     */
    public void attack()
    {
        if (!super.getAttackedFlag())
            switch(super.getAttackCounter())
            {
                case 0: this.setImage(super.getElement(3));  super.attackCounterIncr(); break;
                case 16: this.setImage(super.getElement(4));  super.attackCounterIncr(); super.inflictDamage(20);  break;
                case 32: super.setAttackCounter(0); super.setAttackedFlag(true); break;
                default: super.attackCounterIncr();
            }
    }
}
